<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
</head>
<style type="text/css">
.menu { width: 1000px; margin: 0 auto; height: 30px; padding-top: 4px; background:url(http://img.ifeng.com/tres/finance/ustock/nav/menubg.gif) no-repeat left top; }
.menu ul {list-style:none}
\.menu ul li {float:left;line-height:0px;height:30px;width:80px;font-size:18px}
\.menu. li a{color:#ffffff;}
\.menu b {margin-left: 100px;}

#totallabel li a {color:#ffffff;}
#totallabel li {float:left;line-height:0px;height:30px;width:80px;font-size:18px}
#search-div {margin-left: 800px;margin-top: -15px;}
#search-ul {z-index: 999;background-color:white}
#search-ul li {margin-top:5px;}
#stocklist {margin-left:200px;width:1000px} 
#stocklist ul{width: 800px;margin:0;list-style: none;}
#stocklist li{display: block;float:left;line-height:16px;height:30px;width:120px;font-size:12px}
#stocklist li a{color:#004276;}

a:link,a:visited{text-decoration:none;}
</style>

<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>

<div class="menu">
  <ul id="totallabel">
    <li><a href="sh.html">沪市</a></li> 
    <li><a href="sz.html">深市</a></li> 
    <li><a href="sz300.html">创业板</a></li> 
    <li><a id="jishuzhibiao" href="#nogo">技术指标</a></li> 
  </ul>
  <div id="search-div">
    <input id="search-input" style="width=200px"/>
    <ul id="search-ul" style="position:absolute;border:1px #000 solid;margin:0px;padding:10;width:100px;list-style:none"></ul>
  </div>
</div>

<style type="text/css">
div.stockview {margin-left:auto;margin-right:auto;width:1100px}
.detailpanel {width:950px;height:450px;border:1px solid #DFE9F2;margin-top:5px;}
.detailpanel img {width:600px}
.imgblock {list-style:none;float:left}
.infoblock {list-style:none;float:left;margin-top:10px}
\.blocklist {float:left}
.infolist {list-style:none;width:300px;}
</style>

<script type="text/javascript">
$('#search-input').keyup(function() {
    // alert($(this).val());
    $.ajax({
        context : $(this).parent(),
        url : "/search.do?src=" + $(this).val(),
        success : function(rsp) {
          $("#search-ul").empty();
          $.globalEval('var nodes=' + rsp);
          for(var n in nodes) {
            $("#search-ul").append($('<li style="font-size:9px;margin-left:1px;margin:0;margin-top:5px"><a href="http://stockdata.stock.hexun.com/' 
            + nodes[n][0] + '.shtml">' 
            + nodes[n][0] + ' ' + nodes[n][1] + '</a></li>'));
          }
        }
      }
    );
  }
);

function handleTop10Detail(text){
  $.globalEval('var stocks='+text);
  var i=0;
  for(var o in stocks){
    var code = stocks[o].code;
    var flag="";
    //alert(code);
    var li = $('<li class=\'imgblock\'><img src=\'/' + code + '.gif\'></img></li>'); 
    $.globalEval('var info='+stocks[o].detail);
    var infoul = $('<li class=\'infoblock\'><ul></ul></li>');
    for(var j in info){
      var tmpli = $('<li class=\'infolist\'>'+j+info[j]+'</li>');
      infoul.children("ul").append(tmpli);
    }
    var paneldiv=$('<div class=\'detailpanel\'></div>');
    paneldiv.append(li);
    paneldiv.append(infoul);
    //alert(infoul.html());
    $(".stockview ul.stocklist").append(paneldiv); 
    //$(".stockview ul.stocklist").append(infoul);
  } 
}

$(document).ready(function(){
  $.ajax({
          url : "/top10detail.do?topname=waveup", 
          success : function(text) {
            handleTop10Detail(text);
          }
      }
    );
})
$("#jishuzhibiao").click(function(){
    $.ajax({
        url : "/top10.do",
        success : function(text) {
          handleTop10(text);
        }
  })
}
)
</script>
<div class="stockview" style="margin-top:20px">
  <ul class="stocklist">
  </ul>
</div>
